package com.pubg.information.serviceImpl;

import com.pubg.information.bean.Members;
import com.pubg.information.mapper.MemberMapper;
import com.pubg.information.service.PersonalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class PersonalServiceImpl implements PersonalService {
    @Autowired(required=false)
    MemberMapper memberMapper;

    @Override
    public Members getMembers(String account) {
        Members memb = memberMapper.getMembersByAccount(account);
        if (StringUtils.isEmpty(memb.getImg())){
            memb.setImg("/img/headImg.jpeg");
        }
        return memb;
    }

    @Override
    public void updMembers(String name, String phone, String brithday, String age, String account) {

        memberMapper.updMember(name,phone,brithday,age,account);
    }

    @Override
    public void updImgUrl(String imgUrl, String account) {
        memberMapper.updImgUrl(imgUrl,account);
    }

}
